package com.pk.platform.business.privilege.web;

import com.pk.platform.business.core.web.GenericAction;
import com.pk.platform.business.privilege.service.IDeptService;
import com.pk.platform.business.privilege.vo.DeptVO;
import com.pk.platform.domain.privilege.Department;

public class DeptAction extends GenericAction {

	private Department dept = new Department();
	
	private DeptVO dvo = new DeptVO();
	
	private IDeptService deptService;
	
	private String[] deptIds;
	
	public String toAddDept()
	{
		return SUCCESS;
	}
	
	public String addDept()
	{
		deptService.addDept(dept);
		return SUCCESS;
	}
	
	public String delDepts()
	{
		if(deptIds != null)
		{
			deptService.delDepts(deptIds);
		}
		this.sendRedirect("inner/dept/queryDept.action");
		return SUCCESS;
	}
	
	public String toUpdateDept()
	{
		dept = deptService.queryDeptById(dept.getId());
		return SUCCESS;
	}
	
	public String updateDept()
	{
		deptService.updateDept(dept);
		return SUCCESS;
	}
	
	public String queryDept()
	{
		lp = deptService.queryDept(dvo, pager);
		return SUCCESS;
	}
	

	
	

	public Department getDept() {
		return dept;
	}

	public void setDept(Department dept) {
		this.dept = dept;
	}

	public DeptVO getDvo() {
		return dvo;
	}

	public void setDvo(DeptVO dvo) {
		this.dvo = dvo;
	}

	public IDeptService getDeptService() {
		return deptService;
	}

	public void setDeptService(IDeptService deptService) {
		this.deptService = deptService;
	}

	public String[] getDeptIds() {
		return deptIds;
	}

	public void setDeptIds(String[] deptIds) {
		this.deptIds = deptIds;
	}
	
}
